package com.chaber.containers.common;

import java.util.Set;

import javax.validation.ConstraintViolation;

import org.springframework.context.ApplicationEvent;

import com.chaber.containers.beans.AbstractObjectData;

public class ConstraintViolationEvent<TYPE extends AbstractObjectData> extends ApplicationEvent {

	private static final long serialVersionUID = -8384963000811587490L;
	
	private Set<ConstraintViolation<TYPE>> constraintViolations;
	private String message;
	
	public ConstraintViolationEvent(Object source) {
		super(source);
	}
	
	public ConstraintViolationEvent(Object source, String message) {
		super(source);
		this.message = message;
	}
	
	public ConstraintViolationEvent(Object source, Set<ConstraintViolation<TYPE>> constraintViolations) {
		super(source);
		this.constraintViolations = constraintViolations;
	}

	public Set<ConstraintViolation<TYPE>> getConstraintViolations() {
		return constraintViolations;
	}

	public void setConstraintViolations(Set<ConstraintViolation<TYPE>> constraintViolations) {
		this.constraintViolations = constraintViolations;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
